<!--
 * @Description: 
 * @Author: charles
 * @Date: 2020-11-03 15:55:55
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2021-09-29 11:36:40
-->
<template>
  <div>
    <div class="wrapper">
      <h2>新西兰海外游学多好玩，光是奥克兰就值得停留一周！</h2>
      <p> <b>项目费用：</b>  元</p>
      <p> <b>起止时间：</b>  2021-11-01 ~ 2020-11-10 </p>
      <p> <b>项目介绍：</b>  伦敦是极具活力和历史感的英国多元文化城市。游览女王白金汉宫，在牛津街购物感受最新流行趋势。我们宽敞的校园环境，距离伦敦眼，大本钟等知名地标步行可达。</p>
      <el-steps :active="active" align-center>
        <el-step title="申请报名" description="用户选择自己喜欢的项目进行报名"></el-step>
        <el-step title="管理员确认" description="管理员确认用户报名，为用户开放账号"></el-step>
        <el-step title="用户付款" description="用户登录后可以进行确认，完成付款"></el-step>
        <el-step title="报名完成" description="报名接受后等待管理员线下通知"></el-step>
      </el-steps>
      <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm" >
        <el-form-item label="姓名" prop="name" style="width:50%; margin:20px auto;">
          <el-input v-model="ruleForm.name"></el-input>
        </el-form-item>
        <el-form-item label="手机号" prop="tel" style="width:50%; margin:20px auto;">
          <el-input v-model="ruleForm.tel"></el-input>
        </el-form-item>
        <el-form-item label="性别" prop="resource" style="width:50% ;margin: 20px auto">
          <el-radio-group v-model="ruleForm.resource">
            <el-radio label="男"></el-radio>
            <el-radio label="女"></el-radio>
          </el-radio-group>
        </el-form-item>
        <el-form-item label="活动时间" required style="width:50% ;margin: 5px auto">
          <el-col :span="11">
            <el-form-item prop="date1">
              <el-date-picker type="date" placeholder="选择日期" v-model="ruleForm.date1" style="width: 100%;"></el-date-picker>
            </el-form-item>
          </el-col>
        </el-form-item>
        <el-form-item label="地址" prop="add" style="width:50%; margin:20px auto;">
          <el-input v-model="ruleForm.add"></el-input>
        </el-form-item>
        <el-form-item style="width:20%; margin:20px auto;">
        <el-button type="primary" @click="submitForm('ruleForm')">立即报名</el-button>
        </el-form-item>

      </el-form>
    </div>
  </div>
</template>
<style lang="scss" scoped>
  .wrapper{
    width: 980px;
    margin: 0 auto;
    h2{
      text-align:center;
      color: black;
    }
  }
</style>
<script>

export default {
   data() {
      return {
        radio: '1',
        active: 1,
        resource: '',
        ruleForm:{
          name:'',
          resource: '',
          tel:'',
          date1: '',
          add:'',
        },
        rules:{
          name: [
            { required: true, message: '请输入用户名', trigger: 'blur' },
            { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
          ],
          tel: [
            { required: true, message: '请输入手机号', trigger: 'blur' },
            { min: 11, max: 11, message: '长度为11个字符', trigger: 'blur' }
          ],
          resource: [
            { required: true, message: '请选择性别', trigger: 'change' }
          ],
          date1: [
            { type: 'date', required: true, message: '请选择日期', trigger: 'change' }
          ],
          add: [
            { required: true, message: '请输入地址', trigger: 'blur' },
            { min: 0, max: 12, message: '', trigger: 'blur' }
          ],
        
        }
      };
    },

    methods: {
      submitForm(formName) {
        if (this.active++ > 3) this.active = 0;
        this.$refs[formName].validate((valid) => {
          if (valid) {
            alert('submit!');
          } else {
            console.log('error submit!!');
            return false;
          }
        });
      },
      resetForm(formName) {
        this.$refs[formName].resetFields();
      },
    }
  }

</script>
